import { Component, OnInit, Input } from '@angular/core';
import {AppGlobalService} from '../../shared/service/app-global.service';
import { EventService } from '../../shared/service/event.service';

@Component({
  selector: 'app-service-brief',
  templateUrl: './service-brief.component.html',
  styleUrls: ['./service-brief.component.scss'],
})
export class ServiceBriefComponent implements OnInit {

  @Input() tagData;any;
  data:any;

  constructor(private appGlobalService: AppGlobalService,
              private eventService: EventService,) { }

  ngOnInit() {
    console.log(this.tagData,'tag')
    this.data = this.tagData.data[0]
  }

  jumpToPage() {
    const sessionId = localStorage.getItem('sessionId');
    let pageParams = {
        pageId: this.data.link.target,
        params: this.data.link.params,
        sessionId: sessionId
    };
    this.appGlobalService.goToForward(pageParams);
}

clickLink(obj) {
  if (!obj) {
      console.log('没有返回link-target');
  }
  const pageParams = {
      pageId: obj.target,
      params: obj.params,
      sessionId: localStorage.getItem('sessionId')
  };
  this.appGlobalService.goToForward(pageParams);
}

}
